package com.zy.dp.iterator.example1;

public class Client
{
	public void test()
	{
		String[] names = { "张三", "李四", "王五" };

		Aggregate aggregate = new ConcreteAggregate(names);
		Iterator iterator = aggregate.createIterator();

		iterator.first();
		while (!iterator.isDone())
		{
			Object obj = iterator.currentItem();
			System.out.println(obj);
			iterator.next();
		}

	}

	public static void main(String[] args)
	{
		Client client = new Client();
		client.test();
	}

}
